<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html">

    <body>
        <ui:composition template="../templates/default3.xhtml">
            <ui:define name="content">
                <h:form id="rawMaterialPurchaseOrders" binding="#{rawMaterialPurchasingManagerBean.loadSearchRawMaterialPurchaseOrders}">
                    <p:panel header="Raw Material Purchase Orders" id="rawMaterialPurchaseOrdersPanel">
                        <p:messages />

                        <p:dataTable id="rmPOs" var="rmPO" value="#{rawMaterialPurchasingManagerBean.rawMaterialPurchaseOrders}" 
                                     update="rawMaterialPurchaseOrdersPanel" paginator="true" rows="10"  
                                     paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                     selection="#{rawMaterialPurchasingManagerBean.selectedRawMaterialPurchaseOrder}"
                                     selectionMode="single"
                                     emptyMessage="No raw material purchase orders found with given criteria.">    
                            <p:column filterBy="#{rmPO.id}" headerText="PO Id" filterMatchMode="contains">  
                                <h:outputText value="#{rmPO.id}" />  
                            </p:column> 
                            <p:column filterBy="#{rmPO.supplier.company}" headerText="Supplier" filterMatchMode="contains">  
                                <h:outputText value="#{rmPO.supplier.company}" />  
                            </p:column> 
                            <p:column filterBy="#{rmPO.employee.name}" headerText="Purchasing Rep." filterMatchMode="contains">  
                                <h:outputText value="#{rmPO.employee.name}" />  
                            </p:column>
                            <p:column filterBy="#{rmPO.deliveryDate}" headerText="Delivery Date" filterMatchMode="contains">  
                                <h:outputText value="#{rmPO.deliveryDate}">
                                    <f:convertDateTime pattern="dd-MMM-yyyy" timeZone="#{defaultManagerBean.tz}"/>
                                </h:outputText>
                            </p:column>                        
                        </p:dataTable> 
                        <table class="table-submit">
                            <tr>
                                <td align="center">

                                </td>
                            </tr>
                        </table>
                    </p:panel>
                </h:form>
            </ui:define>
        </ui:composition>
    </body>
</html>
